/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.res0w.SMMS.ui.admin;

import java.awt.Point;
import java.awt.Polygon;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author res0w
 * @since  2009-9-24
 * @version 0.1
 */
public class AdminWindow extends JFrame {

    private AdminMainPanel sw = new AdminMainPanel();

    public AdminWindow() {
        Point[] points = new Point[]{
            new Point(0, 0),
            new Point(105, 0),
            new Point(105, 52),
            new Point(522, 52),
            new Point(522, 66),
            new Point(547, 66),
            new Point(547, 89),
            new Point(666, 90),
            new Point(1059, 90),
            new Point(1059, 732),
            new Point(29, 732),
            new Point(29, 106),
            new Point(0, 106),};
        Polygon polygon = new Polygon();
        for (int i = 0; i < points.length; i++) {
            polygon.addPoint(points[i].x, points[i].y);
        }
        this.setUndecorated(true);
        setLocationRelativeTo(null);
        com.sun.awt.AWTUtilities.setWindowShape(this, polygon);
//        super(owner);
        this.getContentPane().add(sw);
//        this.setAlwaysOnTop(true);
        this.setTitle("河北经贸大学运动会管理系统");
//        this.setVisible(true);
        this.pack();
    }
/*
 *测试方法*/
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(AdminWindow.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            Logger.getLogger(AdminWindow.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(AdminWindow.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(AdminWindow.class.getName()).log(Level.SEVERE, null, ex);
        }
        java.awt.EventQueue.invokeLater(
                new Runnable() {

                    Point[] points = new Point[]{
                        new Point(0, 0),
                        new Point(105, 0),
                        new Point(105, 52),
                        new Point(522, 52),
                        new Point(522, 66),
                        new Point(547, 66),
                        new Point(547, 89),
                        new Point(666, 90),
                        new Point(1059, 90),
                        new Point(1059, 732),
                        new Point(29, 732),
                        new Point(29, 106),
                        new Point(0, 106),};

                    @Override
                    public void run() {
                        Polygon polygon = new Polygon();
                        for (int i = 0; i < points.length; i++) {
                            polygon.addPoint(points[i].x, points[i].y);
                        }
                        AdminWindow sm = new AdminWindow();
                        sm.setLocationRelativeTo(null);
                        sm.setVisible(true);
                        com.sun.awt.AWTUtilities.setWindowShape(sm, polygon);
                    }
                });
    }
 
}
